#!/usr/bin/env bash
echo "-------sync datasource data-----------"

active=$1

if [ -z "$active" ]
then
    echo "param [dev,test,prod]"
    return 0
fi
echo "===================="
echo "===================="

docker stop sync-multiple-datasource-$active

docker rm sync-multiple-datasource-$active

docker rmi sync-multiple-datasource-$active:latest

docker build -t sync-multiple-datasource-$active:latest --build-arg active=$active -f Dockerfile  .
docker run --name sync-multiple-datasource-$active -p 8879:8879 -d sync-multiple-datasource-$active:latest


